Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 4 - Mappers


About Mappers

A mapper is a communications path between your application and a mapper provider, which is a protocol that allows you to map a name to a network address, if the underlying protocol allows it, and to register that name-address pair so that it becomes visible to all other entities on a network. When you create a mapper, you instantiate a data structure that contains information about the mapper provider's mode of operation, information about the mapper's state, and pointers to mapper functions. These functions are your application's interface to the underlying name-registration protocol. Which functions you use depends on the name-registration protocol you select when you create a mapper. For example, if you select the AppleTalk Name-Binding Protocol (NBP), which supports dynamic name and address registration, you can use all the mapper functions described in this chapter: you can register a name, look up a name, and remove a registered name. If you select the TCP/IP protocol family, which uses the domain name resolver (DNR), this choice does not support dynamic name and address registration, and you can only look up a name that has been registered using other means.

When you create a mapper, you specify which protocol is to provide the name-registration service. You also have the option of specifying the layers of protocols underlying that service; these layers provide basic data-transfer services. For example, AppleTalk's NBP protocol relies on the more basic Datagram Delivery Protocol (DDP) to transfer data as required for name registration and name lookup. You do not have to specify these underlying data-transfer protocols. When you select the name-registration protocol you are interested in, a default configuration is provided. For more information about the default configuration for your protocol, please consult the documentation furnished for that protocol. Of course, as with any Open Transport provider, you do have the choice of specifying the underlying protocols, all the way down to the hardware link. For more information, see the chapter "Configuration Management" in this book.

When you create a mapper, you obtain a mapper reference. A mapper reference, like an endpoint reference, identifies the instance of the provider you have created. You must pass this reference as a parameter to all other mapper functions. You can open multiple mappers. For example, if you are writing a network administration application, you might want to create a mapper for each protocol used over the network. If you do open multiple mappers, the mapper reference tells Open Transport which mapper is invoked for any one function call.

Like endpoint providers, mapper providers also have a state attribute, which helps Open Transport manage these providers. Unlike endpoints, however, mappers do not provide functions that allow you to determine their state.
A mapper can be either in an uninitialized (T_UNINIT) state if it was closed by the system, or in the idle (T_IDLE) state after it has been opened.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996